#ifndef LCD_H_
#define LCD_H_

#include <p18F4550.h>
#include <stdio.h>
#include <delays.h>
#include <string.h>

#define E_pin	LATDbits.LATD7 	// CONFIG LIJNEN DISPLAY
#define RW_pin	LATDbits.LATD6	// '' '' 
#define RS_pin	LATDbits.LATD5	// '' '' 

#define E_TRIS	TRISDbits.TRISD7 	// CONFIG LIJNEN DISPLAY
#define RW_TRIS	TRISDbits.TRISD6	// '' '' 
#define RS_TRIS	TRISDbits.TRISD5	// '' '' 

#define DB4_TRIS	TRISBbits.TRISB1	// DATALIJNEN DISPLAY VOOR TRIS REGISTER
#define DB5_TRIS	TRISBbits.TRISB2	// '' '' 
#define DB6_TRIS	TRISBbits.TRISB3	// '' '' 
#define DB7_TRIS	TRISBbits.TRISB4	// '' '' 

#define DB4	LATBbits.LATB1 	// DATALIJEN DISPLAY
#define DB5	LATBbits.LATB2	// '' '' 
#define DB6	LATBbits.LATB3	// '' '' 
#define DB7	LATBbits.LATB4	// '' '' 

#define DELAY_40US() 	Delay10TCYx(150) 	//40us delay(15)
#define DELAY_40MS() 	Delay10KTCYx(200)  	//200MS (kan ook 15MS worden gemaakt)(100)
#define _BV(bit) (1 << (bit))

//int DATA;


void FLUSH();
void DATA2PIN(unsigned char DATA);
void Character2LCD (unsigned char DATA);
void COMMAND2LCD (unsigned char DATA); 
void ddram2LCD (unsigned char DATA);
void putsROM2LCD(rom char *s);
void puts2LCD (char*s);
void Int2LCD (int i);
void Dec2LCD (int i);
void CURSOR_HOME(void);
void Line1(void);
void Line2(void);\
void MoveCursor(char line,char mc_row);
void InitLCD(void);
#endif
